package com.example.feignClients;

import com.example.config.FeignClientConfig;
import com.example.pojo.dto.BookUpdateDTO;
import com.example.pojo.entity.result.Result;
import com.example.pojo.vo.BookVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "bookservice", path = "/admin/book", configuration = FeignClientConfig.class)
public interface BookClient {
    /**
     * 修改图书信息
     *
     * @param bookUpdateDTO
     */
    @PutMapping
    void updateById(@RequestBody BookUpdateDTO bookUpdateDTO);

    /**
     * 根据图书编号查询图书信息
     *
     * @return
     */
    @GetMapping("/{id}")
    @ApiOperation("根据图书编号查询图书信息")
    Result<BookVO> getById(@PathVariable String id);


}
